<?php
require 'lib/init.php';
$conn=mConn();
mQuery("delete from cat where cat_id=$_GET[id];");
if(mysqli_affected_rows($conn)>0){
//    echo '栏目删除成功';
//    header('refresh:2;url=catlist.php');
    success('栏目删除成功');
}else{
    if(mysqli_errno($conn)){
        echo mysqli_errno($conn).':'.mysqli_error($conn);
        header('refresh:2;url=catlist.php');
        exit();
    }else{
//        echo '被删除栏目的id不存在';
//        header('refresh:2;url=catlist.php');
        error('被删除栏目的id不存在');
        exit();
    }
}
